<template>
	<view id="loading" class="loading" :class="{'show': show}">
		<image src="@/public/images/public/loading.gif" mode="aspectFit"></image>
	</view>
</template>

<script>
	/**
	 * ShowLoading 请求加载动画
	 * @description 网络请求加载动画动图版
	 */
	export default {
		name:"ShowLoading",
		data() {
			return {
				show: true
			};
		},
		methods: {
			//关闭
			close() {
				this.show = false
			},
			//打开
			load() {
				this.show = true
			}
		}
	}
</script>

<style lang="scss">
	.loading{
		z-index: 999;
		background-color: rgba(0, 0, 0, 0);
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		margin: 0 auto;
		width: 100vw;
		height: 100vh;
		position: fixed;
		top: 0;
		bottom: 0;
		visibility: hidden;
		image{
			width: 240rpx;
			height: 240rpx;
			background-color: rgba(0, 0, 0, 0.15);
			border-radius: 20rpx;
		}
		&.show{
			visibility: visible;
		}
	}
</style>